import {get,post,del} from "../utils/request";

// 获取购物车数据API

export const loadCartsAPI = () =>get("/api/v1/shop_carts");

// 加入购物车API
// 参数 商品，数量，价格
/**
 * 
 * @param {*} product 
 * @param {*} amount 
 * @param {*} price 
 * @returns 
 */
export const addToCartAPI = (product,amount,price) =>post('/api/v1/shop_carts',{product,amount,price});

//删除购物车数据

export const deleteCartAPI = (id)=>del("/api/v1/shop_carts/"+id)